class Router {
	constructor(arg) {
	    this.callBack=()=>{}
	}
	beforeEach(callback){
		this.callBack=callback
	}
	//uni.navigateTo()的封装
	push(to) {
		// console.log("push")
		this.callBack("navigateTo", to);
	}
	//uni.redirectTo()的封装
	redirectTo(to) {
		this.callBack("redirectTo", to);
	}
	//uni.relaunch()的封装
	reLaunch(to) {
		this.callBack("reLaunch", to);
	}
	//uni.switchTab()的封装
	switchTab(to) {
		this.callBack("switchTab", to);
	}
	//uni.navigateBack()的封装
	back(delta) {
		uni.navigateBack({
			delta
		})
	}
}

export default new Router()
